package com.ynny.service;

import com.ynny.dao.AccountDao;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;

@Service(value = "accountService")
public class AccountServiceImpl implements AccountService{

    @Autowired
    AccountDao accountDao;

    @Override
    public void transfer(String outAccount,
     String inAccount, BigDecimal money) {
        //转账

        //1.A减少钱
        accountDao.subAccount(outAccount,money);
        //
        //2.B增加钱
        accountDao.addAccount(inAccount,money);

        //3......
        
    }
}
